from fastapi import APIRouter, Request
from utils import create_json_response

router = APIRouter()

@router.post("/profile/mine")
async def get_profile_mine(request: Request):
    """个人中心元数据接口 - 直接返回演示数据"""
    
    # 演示数据
    profile_data = {
        "info": {
            "nickname": "刘先生",
            "url": "http://demo.example.com/avatar_4.jpg"
        },
        "meta": [
            {
                "name": "我的客户",
                "count": "22",
                "url": "app://one"
            },
            {
                "name": "订单数",
                "count": "3,831",
                "url": ""
            },
            {
                "name": "销售额",
                "count": "¥1,283,923",
                "url": "app://two@to/pages/chart/index"
            },
            {
                "name": "待审批",
                "count": "8",
                "url": "app://three"
            },
            {
                "name": "已完成",
                "count": "156",
                "url": "app://four"
            },
            {
                "name": "本月目标",
                "count": "¥500,000",
                "url": "app://five@to/pages/target/index"
            }
        ],
        "update": "true",  # 为 true 时表示有新版本
        "items": [
            {
                "name": "帮助中心",
                "icon": "question-line",
                "url": "app://one"
            },
            {
                "name": "我的订单",
                "icon": "list-check-3",
                "url": "https://demo.com"
            }
        ]
    }
    
    return create_json_response(profile_data)